package com.jml.dubbo.server.loadBalance.impl;

import java.util.List;

import com.jml.dubbo.server.loadBalance.LoadBalance;


public class LoopLoadBalance implements LoadBalance {
    /**
     * 8080
     * 8081
     *
     * @param repos
     * @return
     */
    private int index;

    @Override
    public synchronized String select(List<String> repos) {
        if (index >= repos.size()) {
            index = 0;
        }
        String value = repos.get(index++);
        System.out.println("value:" + value);
        return value;
    }
}
